package Help.Manager.Album;

import DAO.AlbumsController;
import DAO.PhotosData;


/*
 * Class App chứa thể hiện duy nhất những đối tượng sử dụng trong ứng dụng.
 */
public class App {
	private static PhotosData photosData;
	public static PhotosData getPhotosData() {
		if(photosData == null) {
			photosData = new PhotosData();
		}
		
		return photosData;
	}
	
	private static AlbumsController albumsCtrl;
	public static AlbumsController getAlbumsController() {
		if(albumsCtrl == null) {
			albumsCtrl = new AlbumsController();
		}
		
		return albumsCtrl;
	}
	
	private static PhotosGroupedController photosGroupedCtrl;
	public static PhotosGroupedController getPhotosGroupedController() {
		if(photosGroupedCtrl == null) {
			photosGroupedCtrl = new PhotosGroupedController();
			photosGroupedCtrl.setPhotos(getPhotosData().getPhotos());
		}
		
		return photosGroupedCtrl;
	}
}
